<%--
  Created by IntelliJ IDEA.
  User: zjzhai
  Date: 9/29/13
  Time: 9:40 PM
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>注册</title>
</head>
<body>
<div class="container">

    <div class="row">
        <g:if test="${account !=null && account.hasErrors()}">
            <g:hasErrors bean="${account}">
                <ul>
                    <g:eachError var="err" bean="${account}">
                        <li><g:message error="${err}" /></li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
    </g:if>
        <g:elseif test="${account !=null && !account.hasErrors()}">
            <div class="alert alert-success">注册成功，请<g:link controller="account" action="login" params="[id:account.id]">登录</g:link></div>
        </g:elseif>
    </div>
    <div class="row">
    <g:form controller="account" action="reg">
       用户名：<g:textField name="name" value="${account?.name}"/>                             <br/>
       显示名：<g:textField name="showName" value="${account?.showName}"/>                              <br/>
       密码：<g:passwordField name="password" id="password"/>                   <br/>
        重复密码：<g:passwordField name="repassword" id="repassword"/>                <br/>
        <g:submitButton name="submit" value="注册"/>
    </g:form>
    &nbsp;<g:link controller="account" action="login">已有帐号？</g:link>
    </div>
</div>
</body>
</html>